<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>

</h:head>
<title>Lista de lojas</title>
<h:body>
	<f:view>
		<h:form>
			<center>
				<h:form>
					<p:panel>
						<p:panelGrid columns="3">
							
								<p:commandLink value="Inicio" action="menu.xhtml" />
								<p:commandLink value="Nova Loja"
									action="cadastro-de-lojas.xhtml" />
								<p:commandLink value="Relatórios"
									action="lista-de-usuarios.xhtml" />
					
						</p:panelGrid>
					</p:panel>
					<p:dataTable style="font-size: 12px" value="#{lojaBean.lojas}"
						var="loja" border="1" emptyMessage="Não ha registros"
						filterBay="#{lojaBean.loja}" id="tabela">
						<p:column>
							<f:facet name="header">
			   	   Codigo
			        </f:facet>
							<h:outputText value="#{loja.id}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	    Razão Social
			        </f:facet>
							<h:outputText value="#{loja.razaoSocial}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Fantasia
			        </f:facet>
							<h:outputText value="#{loja.fantasia}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   CNPJ
			        </f:facet>
							<h:outputText value="#{loja.cnpj}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Endereço
			        </f:facet>
							<h:outputText value="#{loja.endereco.endereco}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Complemento
			        </f:facet>
							<h:outputText value="#{loja.endereco.complemento}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Bairro
			        </f:facet>
							<h:outputText value="#{loja.endereco.bairro}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   cep
			        </f:facet>
							<h:outputText value="#{loja.endereco.cep}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   cidade
			        </f:facet>
							<h:outputText value="#{loja.endereco.cidade}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Estado
			        </f:facet>
							<h:outputText value="#{loja.endereco.estado}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Telefones
			        </f:facet>
							<h:outputText
								value="#{loja.contato.telefone}/#{loja.contato.telefoneAux}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Emails
			        </f:facet>
							<h:outputText
								value="#{loja.contato.email}/#{loja.contato.emailAux}" />
						</p:column>
						<p:column>
							<f:facet name="header">
			   	   Ações
			        </f:facet>
							<p:commandButton value="Remover" id="remove"
								actionListener="#{lojaBean.removerLoja}">
								<f:param name="idLoja" value="#{loja.id}" />
							</p:commandButton>
						</p:column>
					</p:dataTable>
				</h:form>
			</center>
		</h:form>
	</f:view>
</h:body>
</html>
